From: Florian Müllner Date: Wed, 11 Mar 2015 21:20:21 +0000 (+0100) Subject: calendar: Close messages on clear X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1510 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e4ad31a5ddec3a9cca839e7a2cf86edfb5145dab;p=gnome-shell.git calendar: Close messages on clear Currently the clear action in the section header simply removes all messages from the section. While the result looks exactly as if the close button of each individual message had been clicked, the messages are not actually closed - after a restart (or some other condition that triggers a reload), the messages simply reappear, which is confusing. Do the expected thing instead, and make clear close all messages in the section. https://bugzilla.gnome.org/show_bug.cgi?id=746027 --- diff --git a/js/ui/calendar.js b/js/ui/calendar.js index dda733c7c..93d5e7d3b 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -1382,8 +1382,9 @@ const MessageListSection = new Lang.Class({ // If there are few messages, letting them all zoom out looks OK if (messages.length < 2) { - messages.forEach(Lang.bind(this, function(message) { - this.removeMessage(message, true); })); + messages.forEach(function(message) { + message.close(); + }); } else { // Otherwise we slide them out one by one, and then zoom them // out "off-screen" in the end to smoothly shrink the parent @@ -1397,9 +1398,9 @@ const MessageListSection = new Lang.Class({ time: MESSAGE_ANIMATION_TIME, delay: i * delay, transition: 'easeOutQuad', - onComplete: Lang.bind(this, function() { - this.removeMessage(message, true); - })}); + onComplete: function() { + message.close(); + }}); } } },